/**
 *	\file AKCPPTTTStateMaintainer.h
 *  
 *  \section desc_sec Description
 *  Description
 *  
 *  \if copyright
 *  	Copyright 2008 Ben Chen. All rights reserved.
 *  \endif
 *  
 *  \section hist_sec Change History:
 *  	-	1/22/08		BC		Created this file
 *  
 *  <hr>
 *  \addtogroup AKCPP
 *  @{
 */

#ifndef _AKCPPTTTSTATEMAINTAINER_H
#define _AKCPPTTTSTATEMAINTAINER_H

#include "AbstractClasses.h"

#define NUM_CELLS 9

#define BLACK 0
#define WHITE 1

class AKCPPTTTStateMaintainer : public AKCPPStateMaintainer
{
	typedef AKCPPStateMaintainer PARENT;
public:
	AKCPPTTTStateMaintainer(unsigned int aNumOfSides);
	virtual ~AKCPPTTTStateMaintainer();
	
	virtual const vector<AKPiece>*	getCreatedPieces();
	virtual const vector<AKPiece>*	getElminatedPieces();
	virtual const vector<AKMove>*	getMovedPieces();
	virtual const vector<AKPiece>*	getAllPieces();


	virtual void backToInitialState();
	virtual bool performMove(const AKMove newMove);
	virtual bool canUndo();
	virtual bool undo();
	
	virtual const AKSideIndex getNextPlayerSide();
	virtual const vector<AKSideIndex>*	getWinners();
	
	virtual const AKMove getAlternativeMoveForNextPlayer();
		
	virtual const vector<AKPiece>*		getPlaceablePiecesAtCell(const AKCellIndex);
	virtual const vector<AKCellIndex>*	getReachableCellsForPiece(const AKPiece piece);
private:
	AKPiece		cells[NUM_CELLS];
	AKSideIndex nextPlayer;
	AKMove		lastMove;

	vector<AKSideIndex> *winners;
	vector<AKCellIndex>	*reachableCells;
	vector<AKPiece>		*somePieces;
	vector<AKPiece>		*allPieces;
	vector<AKMove>		*movedPieces;
};	

#endif	// _AKCPPTTTSTATEMAINTAINER_H

/** @} */

